package com.huifer.planar.aset.utils.shptools.polygontools.geometry;


import com.huifer.planar.aset.utils.shptools.polygontools.entity.LatLngEntity;

import java.util.ArrayList;

/**
 * <p>Title : ConvexTest </p>
 * <p>Description : 凸包测试</p>
 *
 * @author huifer
 * @date 2018/10/8
 */
public class ConvexTest {
    public static void main(String[] args) {

        ConvexHull convexHull = new ConvexHull();

        ArrayList<LatLngEntity> list = new ArrayList<LatLngEntity>();


        list.add(new LatLngEntity(91488.22194, 74336.77341));
        list.add(new LatLngEntity(91506.43613, 74335.30988));
        list.add(new LatLngEntity(91506.97427, 74335.22729));
        list.add(new LatLngEntity(91512.07183, 74334.68653));
        list.add(new LatLngEntity(91513.34768, 74334.57683));
        list.add(new LatLngEntity(91513.88857, 74333.74714));
        list.add(new LatLngEntity(91529.5778, 74334.03819));
        list.add(new LatLngEntity(91530.68468, 74333.94972));
        list.add(new LatLngEntity(91547.29938, 74332.90133));
        list.add(new LatLngEntity(91547.1211, 74332.85799));
        list.add(new LatLngEntity(91475.02388, 74344.25929));
        list.add(new LatLngEntity(91475.0148, 74345.3847));
        list.add(new LatLngEntity(91474.93312, 74345.1215));
        list.add(new LatLngEntity(91474.9785, 74344.74939));
        list.add(new LatLngEntity(91475.00573, 74344.53157));
        list.add(new LatLngEntity(91474.96942, 74345.62067));
        list.add(new LatLngEntity(91475.36646, 74352.14797));
        list.add(new LatLngEntity(91475.37862, 74353.01693));
        list.add(new LatLngEntity(91475.88802, 74361.57398));
        list.add(new LatLngEntity(91475.6518, 74360.65232));
        list.add(new LatLngEntity(91475.94403, 74363.3465));
        list.add(new LatLngEntity(91517.49095, 74375.56951));
        list.add(new LatLngEntity(91516.76488, 74375.60178));
        list.add(new LatLngEntity(91513.43531, 74375.96463));
        list.add(new LatLngEntity(91511.95568, 74375.88515));
        list.add(new LatLngEntity(91510.34529, 74376.26854));
        list.add(new LatLngEntity(91512.32678, 74375.91742));
        list.add(new LatLngEntity(91512.9674, 74375.98077));
        list.add(new LatLngEntity(91514.14524, 74375.86782));
        list.add(new LatLngEntity(91515.8936, 74375.61792));
        list.add(new LatLngEntity(91518.00726, 74375.65019));
        list.add(new LatLngEntity(91522.74992, 74375.22969));
        list.add(new LatLngEntity(91524.29887, 74375.18128));
        list.add(new LatLngEntity(91525.78126, 74375.08447));
        list.add(new LatLngEntity(91526.54363, 74374.99976));
        list.add(new LatLngEntity(91526.79977, 74374.98766));
        list.add(new LatLngEntity(91536.64585, 74376.12644));
        list.add(new LatLngEntity(91549.44773, 74332.91217));
        list.add(new LatLngEntity(91564.62233, 74403.69225));
        list.add(new LatLngEntity(91546.51075, 74332.80261));
        list.add(new LatLngEntity(91538.84228, 74333.27936));
        list.add(new LatLngEntity(91531.27653, 74333.74973));
        list.add(new LatLngEntity(91528.53887, 74333.91994));
        list.add(new LatLngEntity(91521.72251, 74334.34372));
        list.add(new LatLngEntity(91514.5038, 74334.79252));
        list.add(new LatLngEntity(91504.68154, 74335.40318));
        list.add(new LatLngEntity(91497.7244, 74335.83571));
        list.add(new LatLngEntity(91488.29766, 74336.42178));
        list.add(new LatLngEntity(91481.20794, 74380.81114));
        list.add(new LatLngEntity(91481.22329, 74385.74718));
        list.add(new LatLngEntity(91568.99729, 74419.32421));
        list.add(new LatLngEntity(91516.81519, 74355.98754));
        list.add(new LatLngEntity(91519.70093, 74355.71959));
        list.add(new LatLngEntity(91563.92296, 74392.15954));
        list.add(new LatLngEntity(91562.69476, 74384.27499));
        list.add(new LatLngEntity(91562.58526, 74376.62281));
        list.add(new LatLngEntity(91561.8709, 74369.70363));
        list.add(new LatLngEntity(91561.50507, 74365.43756));
        list.add(new LatLngEntity(91561.2698, 74362.01602));
        list.add(new LatLngEntity(91561.2939, 74360.58904));
        list.add(new LatLngEntity(91561.18617, 74358.47664));
        list.add(new LatLngEntity(91561.18617, 74357.60728));
        list.add(new LatLngEntity(91560.92536, 74353.89075));
        list.add(new LatLngEntity(91560.52333, 74349.65641));
        list.add(new LatLngEntity(91561.07896, 74345.93873));
        list.add(new LatLngEntity(91561.01376, 74342.61341));
        list.add(new LatLngEntity(91552.03094, 74423.23127));
        list.add(new LatLngEntity(91551.35551, 74423.23934));
        list.add(new LatLngEntity(91543.04445, 74423.88241));
        list.add(new LatLngEntity(91486.04745, 74333.4653));
        list.add(new LatLngEntity(91487.05325, 74334.06894));
        list.add(new LatLngEntity(91506.23538, 74332.80338));
        list.add(new LatLngEntity(91506.94057, 74332.20046));
        list.add(new LatLngEntity(91511.16017, 74332.67881));
        list.add(new LatLngEntity(91512.04623, 74331.98565));
        list.add(new LatLngEntity(91513.10494, 74332.51922));
        list.add(new LatLngEntity(91513.77214, 74331.92535));
        list.add(new LatLngEntity(91529.39471, 74330.96653));
        list.add(new LatLngEntity(91530.48346, 74331.53806));
        list.add(new LatLngEntity(91547.2978, 74330.61639));
        list.add(new LatLngEntity(91549.38801, 74330.57886));
        list.add(new LatLngEntity(91547.1273, 74330.0309));
        list.add(new LatLngEntity(91550.44801, 74329.84147));
        list.add(new LatLngEntity(91471.53125, 74344.46133));
        list.add(new LatLngEntity(91472.42156, 74344.69713));
        list.add(new LatLngEntity(91472.46863, 74345.50004));
        list.add(new LatLngEntity(91471.63581, 74345.63315));
        list.add(new LatLngEntity(91472.92444, 74352.86421));
        list.add(new LatLngEntity(91472.28407, 74353.33105));
        list.add(new LatLngEntity(91473.43024, 74361.72325));
        list.add(new LatLngEntity(91473.06855, 74363.44868));
        list.add(new LatLngEntity(91471.26259, 74334.21601));
        list.add(new LatLngEntity(91472.07866, 74335.01989));
        list.add(new LatLngEntity(91474.73609, 74380.36993));
        list.add(new LatLngEntity(91475.2355, 74385.92909));
        list.add(new LatLngEntity(91474.58854, 74385.95795));
        list.add(new LatLngEntity(91476.9233, 74406.04821));
        list.add(new LatLngEntity(91477.82328, 74413.53578));
        list.add(new LatLngEntity(91478.32575, 74380.13815));
        list.add(new LatLngEntity(91481.23961, 74380.05526));
        list.add(new LatLngEntity(91511.85805, 74378.35545));
        list.add(new LatLngEntity(91513.44307, 74378.38034));
        list.add(new LatLngEntity(91513.346, 74379.07845));
        list.add(new LatLngEntity(91516.92377, 74378.1807));
        list.add(new LatLngEntity(91517.58794, 74378.13564));
        list.add(new LatLngEntity(91512.65019, 74379.21137));
        list.add(new LatLngEntity(91514.1051, 74379.15443));
        list.add(new LatLngEntity(91516.16404, 74379.12468));
        list.add(new LatLngEntity(91518.01789, 74379.02621));
        list.add(new LatLngEntity(91520.57737, 74377.90683));
        list.add(new LatLngEntity(91522.1934, 74378.69265));
        list.add(new LatLngEntity(91522.76823, 74377.81891));
        list.add(new LatLngEntity(91525.09808, 74377.71681));
        list.add(new LatLngEntity(91525.34102, 74378.42946));
        list.add(new LatLngEntity(91526.65297, 74378.39571));
        list.add(new LatLngEntity(91526.84, 74377.67048));
        list.add(new LatLngEntity(91528.32271, 74378.21449));
        list.add(new LatLngEntity(91536.12816, 74377.24484));
        list.add(new LatLngEntity(91536.01216, 74377.85424));
        list.add(new LatLngEntity(91536.62612, 74377.83042));
        list.add(new LatLngEntity(91482.56482, 74405.73069));
        list.add(new LatLngEntity(91540.43482, 74401.63459));
        list.add(new LatLngEntity(91497.04422, 74428.63265));
        list.add(new LatLngEntity(91512.54809, 74427.89399));
        list.add(new LatLngEntity(91528.03062, 74426.90236));
        list.add(new LatLngEntity(91528.41571, 74430.72772));
        list.add(new LatLngEntity(91543.7602, 74425.9534));
        list.add(new LatLngEntity(91559.00049, 74424.77409));
        list.add(new LatLngEntity(91568.4708, 74410.82489));
        list.add(new LatLngEntity(91568.09343, 74403.79461));
        list.add(new LatLngEntity(91567.87043, 74400.03603));
        list.add(new LatLngEntity(91567.85033, 74399.35783));
        list.add(new LatLngEntity(91567.30259, 74391.95896));
        list.add(new LatLngEntity(91566.90218, 74384.09282));
        list.add(new LatLngEntity(91566.47336, 74376.72462));
        list.add(new LatLngEntity(91565.97903, 74369.7215));
        list.add(new LatLngEntity(91565.79908, 74365.25488));
        list.add(new LatLngEntity(91565.5097, 74361.22039));
        list.add(new LatLngEntity(91565.3469, 74358.3647));
        list.add(new LatLngEntity(91565.32588, 74357.60275));
        list.add(new LatLngEntity(91565.13763, 74353.66012));
        list.add(new LatLngEntity(91564.80274, 74349.23971));
        list.add(new LatLngEntity(91564.54345, 74346.02315));
        list.add(new LatLngEntity(91564.34877, 74342.50952));
        list.add(new LatLngEntity(91568.60887, 74404.12892));
        list.add(new LatLngEntity(91568.41854, 74400.00602));
        list.add(new LatLngEntity(91568.39532, 74399.20735));
        list.add(new LatLngEntity(91568.01904, 74392.25007));
        list.add(new LatLngEntity(91567.95015, 74391.56147));
        list.add(new LatLngEntity(91567.66574, 74384.51269));
        list.add(new LatLngEntity(91567.64564, 74383.69284));
        list.add(new LatLngEntity(91567.14434, 74376.71273));
        list.add(new LatLngEntity(91567.02795, 74375.67091));
        list.add(new LatLngEntity(91566.77364, 74370.9364));
        list.add(new LatLngEntity(91566.563, 74366.70581));
        list.add(new LatLngEntity(91566.26192, 74361.53099));
        list.add(new LatLngEntity(91566.2299, 74360.46325));
        list.add(new LatLngEntity(91565.96721, 74357.10391));
        list.add(new LatLngEntity(91565.73405, 74353.98532));
        list.add(new LatLngEntity(91565.5506, 74349.89469));
        list.add(new LatLngEntity(91565.26484, 74344.81623));
        list.add(new LatLngEntity(91565.18857, 74341.23666));
        list.add(new LatLngEntity(91518.98592, 74358.01258));
        list.add(new LatLngEntity(91517.0541, 74358.17315));
        list.add(new LatLngEntity(91516.9778, 74357.47519));
        list.add(new LatLngEntity(91518.1881, 74353.90282));
        list.add(new LatLngEntity(91518.25657, 74353.2817));
        list.add(new LatLngEntity(91515.84046, 74358.26089));
        list.add(new LatLngEntity(91513.89036, 74358.38055));
        list.add(new LatLngEntity(91512.23253, 74358.45958));
        list.add(new LatLngEntity(91508.99663, 74358.67449));
        list.add(new LatLngEntity(91505.04592, 74358.86671));
        list.add(new LatLngEntity(91504.25903, 74358.86624));
        list.add(new LatLngEntity(91487.9979, 74359.64907));
        list.add(new LatLngEntity(91515.47066, 74353.49195));
        list.add(new LatLngEntity(91520.25444, 74353.19903));
        list.add(new LatLngEntity(91513.90442, 74357.64237));
        list.add(new LatLngEntity(91513.76874, 74353.57864));
        list.add(new LatLngEntity(91506.2047, 74354.09122));
        list.add(new LatLngEntity(91504.67287, 74354.1638));
        list.add(new LatLngEntity(91487.54916, 74355.0743));
        list.add(new LatLngEntity(91523.84416, 74352.9852));
        list.add(new LatLngEntity(91528.86667, 74352.68156));
        list.add(new LatLngEntity(91535.39408, 74352.28686));
        list.add(new LatLngEntity(91539.60672, 74352.10684));
        list.add(new LatLngEntity(91540.47473, 74352.04571));
        list.add(new LatLngEntity(91544.43437, 74351.81781));
        list.add(new LatLngEntity(91546.88219, 74351.70355));
        list.add(new LatLngEntity(91521.20366, 74357.87262));
        list.add(new LatLngEntity(91525.41407, 74357.46002));
        list.add(new LatLngEntity(91529.20634, 74357.1063));
        list.add(new LatLngEntity(91519.10193, 74357.30844));
        list.add(new LatLngEntity(91522.60461, 74356.95959));
        list.add(new LatLngEntity(91526.62098, 74356.65543));
        list.add(new LatLngEntity(91529.17374, 74356.42167));
        list.add(new LatLngEntity(91513.17546, 74357.66734));
        list.add(new LatLngEntity(91510.70774, 74357.85963));
        list.add(new LatLngEntity(91506.62811, 74358.10507));
        list.add(new LatLngEntity(91519.57618, 74353.80887));
        list.add(new LatLngEntity(91528.88464, 74353.40951));
        list.add(new LatLngEntity(91534.84787, 74353.14627));
        list.add(new LatLngEntity(91539.41356, 74352.89677));
        list.add(new LatLngEntity(91540.70873, 74352.81675));
        list.add(new LatLngEntity(91546.955, 74352.30743));
        list.add(new LatLngEntity(91548.27091, 74352.25468));
        list.add(new LatLngEntity(91518.92035, 74353.87379));
        list.add(new LatLngEntity(91487.06893, 74355.6008));
        list.add(new LatLngEntity(91487.22687, 74359.0765));
        list.add(new LatLngEntity(91485.73963, 74359.72087));
        list.add(new LatLngEntity(91484.79826, 74359.79916));
        list.add(new LatLngEntity(91472.90896, 74360.82812));
        list.add(new LatLngEntity(91479.05619, 74429.27513));
        list.add(new LatLngEntity(91488.11584, 74334.52351));
        list.add(new LatLngEntity(91497.70977, 74333.78773));
        list.add(new LatLngEntity(91504.61725, 74333.44752));
        list.add(new LatLngEntity(91514.4096, 74333.02446));
        list.add(new LatLngEntity(91521.67388, 74332.54178));
        list.add(new LatLngEntity(91528.49743, 74332.24569));
        list.add(new LatLngEntity(91531.25221, 74332.10202));
        list.add(new LatLngEntity(91538.82149, 74331.61893));
        list.add(new LatLngEntity(91546.39089, 74331.22184));
        list.add(new LatLngEntity(91552.67432, 74330.83647));
        list.add(new LatLngEntity(91555.89709, 74330.69017));
        list.add(new LatLngEntity(91472.95834, 74340.78654));
        list.add(new LatLngEntity(91474.0578, 74359.4143));
        list.add(new LatLngEntity(91473.0325, 74335.6556));
        list.add(new LatLngEntity(91474.40119, 74365.43784));
        list.add(new LatLngEntity(91475.364, 74379.55512));
        list.add(new LatLngEntity(91485.17295, 74378.89637));
        list.add(new LatLngEntity(91488.44482, 74378.76569));
        list.add(new LatLngEntity(91495.46285, 74378.56887));
        list.add(new LatLngEntity(91502.69191, 74378.18169));
        list.add(new LatLngEntity(91506.06275, 74378.0862));
        list.add(new LatLngEntity(91512.59608, 74377.62849));
        list.add(new LatLngEntity(91519.85052, 74377.25882));
        list.add(new LatLngEntity(91520.52407, 74377.23574));
        list.add(new LatLngEntity(91521.74039, 74377.1783));
        list.add(new LatLngEntity(91526.31372, 74376.70821));
        list.add(new LatLngEntity(91537.10505, 74376.28483));
        list.add(new LatLngEntity(91543.89661, 74376.00077));
        list.add(new LatLngEntity(91475.70333, 74382.80356));
        list.add(new LatLngEntity(91476.17621, 74388.72475));
        list.add(new LatLngEntity(91477.56444, 74403.15244));
        list.add(new LatLngEntity(91477.81023, 74406.75));
        list.add(new LatLngEntity(91479.78928, 74428.55668));
        list.add(new LatLngEntity(91491.51624, 74385.10539));
        list.add(new LatLngEntity(91498.69182, 74384.73898));
        list.add(new LatLngEntity(91505.20002, 74384.29744));
        list.add(new LatLngEntity(91508.59005, 74384.33263));
        list.add(new LatLngEntity(91515.15257, 74384.01488));
        list.add(new LatLngEntity(91521.39886, 74383.52856));
        list.add(new LatLngEntity(91526.07091, 74387.34921));
        list.add(new LatLngEntity(91511.43332, 74389.05069));
        list.add(new LatLngEntity(91511.71001, 74392.57321));
        list.add(new LatLngEntity(91512.59817, 74386.70021));
        list.add(new LatLngEntity(91492.31122, 74399.34388));
        list.add(new LatLngEntity(91499.80264, 74398.9649));
        list.add(new LatLngEntity(91506.15105, 74398.56544));
        list.add(new LatLngEntity(91509.65564, 74398.28277));
        list.add(new LatLngEntity(91513.30672, 74396.12097));
        list.add(new LatLngEntity(91515.19554, 74397.4954));
        list.add(new LatLngEntity(91503.35034, 74404.53658));
        list.add(new LatLngEntity(91514.14467, 74404.33759));
        list.add(new LatLngEntity(91525.73574, 74403.72014));
        list.add(new LatLngEntity(91522.18678, 74397.24006));
        list.add(new LatLngEntity(91526.48468, 74393.18047));
        list.add(new LatLngEntity(91534.29384, 74403.11274));
        list.add(new LatLngEntity(91558.54666, 74424.15072));
        list.add(new LatLngEntity(91562.45909, 74419.3111));
        list.add(new LatLngEntity(91567.7518, 74410.81785));
        list.add(new LatLngEntity(91567.27205, 74404.2507));
        list.add(new LatLngEntity(91566.96447, 74399.31326));
        list.add(new LatLngEntity(91565.83202, 74380.21437));
        list.add(new LatLngEntity(91564.92445, 74364.77606));
        list.add(new LatLngEntity(91563.82151, 74346.06312));
        list.add(new LatLngEntity(91552.03494, 74424.51188));
        list.add(new LatLngEntity(91543.27618, 74425.18407));
        list.add(new LatLngEntity(91516.8945, 74426.73322));
        list.add(new LatLngEntity(91511.46299, 74427.06346));
        list.add(new LatLngEntity(91499.83017, 74427.86596));
        list.add(new LatLngEntity(91518.2608, 74358.70452));
        list.add(new LatLngEntity(91519.03809, 74358.66485));
        list.add(new LatLngEntity(91525.45923, 74358.33393));
        list.add(new LatLngEntity(91531.68471, 74357.98363));
        list.add(new LatLngEntity(91524.59095, 74352.11128));
        list.add(new LatLngEntity(91527.14175, 74351.97888));
        list.add(new LatLngEntity(91532.54047, 74351.81468));
        list.add(new LatLngEntity(91543.78865, 74351.27769));
        list.add(new LatLngEntity(91516.00513, 74358.93653));
        list.add(new LatLngEntity(91511.66442, 74359.12331));
        list.add(new LatLngEntity(91498.63733, 74359.71268));
        list.add(new LatLngEntity(91494.59993, 74360.13805));
        list.add(new LatLngEntity(91488.03574, 74360.6958));
        list.add(new LatLngEntity(91515.82823, 74357.51481));
        list.add(new LatLngEntity(91515.48934, 74354.05007));
        list.add(new LatLngEntity(91515.42583, 74352.70849));
        list.add(new LatLngEntity(91513.79299, 74352.81967));
        list.add(new LatLngEntity(91505.18682, 74353.38214));
        list.add(new LatLngEntity(91487.82212, 74354.23128));
        list.add(new LatLngEntity(91489.7766, 74339.64143));
        list.add(new LatLngEntity(91492.4317, 74339.49256));
        list.add(new LatLngEntity(91503.91584, 74337.4232));
        list.add(new LatLngEntity(91509.81486, 74337.1598));
        list.add(new LatLngEntity(91510.86004, 74337.09029));
        list.add(new LatLngEntity(91523.98236, 74337.77658));
        list.add(new LatLngEntity(91527.71883, 74337.54329));
        list.add(new LatLngEntity(91538.20891, 74336.90703));
        list.add(new LatLngEntity(91543.51267, 74336.68785));
        list.add(new LatLngEntity(91552.52528, 74333.0606));
        list.add(new LatLngEntity(91555.98603, 74332.89798));
        list.add(new LatLngEntity(91475.75709, 74359.37622));
        list.add(new LatLngEntity(91476.60851, 74376.94954));
        list.add(new LatLngEntity(91485.06361, 74377.37067));
        list.add(new LatLngEntity(91488.42898, 74377.09804));
        list.add(new LatLngEntity(91502.60893, 74376.40972));
        list.add(new LatLngEntity(91506.01698, 74376.28427));
        list.add(new LatLngEntity(91512.55574, 74375.73586));
        list.add(new LatLngEntity(91521.67092, 74375.34791));
        list.add(new LatLngEntity(91526.26004, 74375.07888));
        list.add(new LatLngEntity(91537.05714, 74374.57905));
        list.add(new LatLngEntity(91543.82968, 74374.30823));
        list.add(new LatLngEntity(91503.44164, 74406.48681));
        list.add(new LatLngEntity(91514.48958, 74405.77209));
        list.add(new LatLngEntity(91526.26407, 74405.47438));
        list.add(new LatLngEntity(91562.59264, 74415.91058));
        list.add(new LatLngEntity(91564.57143, 74403.76832));
        list.add(new LatLngEntity(91564.29095, 74399.65482));
        list.add(new LatLngEntity(91562.84015, 74380.29136));
        list.add(new LatLngEntity(91561.82563, 74364.14222));
        list.add(new LatLngEntity(91562.02822, 74365.33391));
        list.add(new LatLngEntity(91560.66457, 74346.08233));
        list.add(new LatLngEntity(91511.37262, 74425.07779));
        list.add(new LatLngEntity(91516.91917, 74424.61882));
        list.add(new LatLngEntity(91499.86908, 74425.57429));
        list.add(new LatLngEntity(91475.34988, 74377.21521));
        list.add(new LatLngEntity(91488.65421, 74380.56235));
        list.add(new LatLngEntity(91495.56642, 74380.01314));
        list.add(new LatLngEntity(91505.91469, 74379.54135));
        list.add(new LatLngEntity(91492.57364, 74404.16138));
        list.add(new LatLngEntity(91511.04232, 74431.80987));
        list.add(new LatLngEntity(91500.08448, 74432.59747));


        ArrayList<LatLngEntity> convexHullPts = convexHull.getConvexHull(list);


//        convexHullPts.forEach(
//                s -> System.out.println(s.getLng() + " , " + s.getLat())
//        );


    }
}
